package com.example.common.config;

import org.apache.ibatis.logging.Log;

/**
 * 打印SQL语句配置类
 * 参考源码类 org.apache.ibatis.logging.stdout.StdOutImpl
 * @author GuLin
 * @date 2021-05-29 10:04
 */
public class MybatisPlusOutImpl implements Log{

    public MybatisPlusOutImpl(String clazz) {
        //System.out.println("MybatisPlusOutImpl::"+clazz);
    }

    @Override
    public boolean isDebugEnabled() {
        return true;
    }
    @Override
    public boolean isTraceEnabled() {
        return true;
    }
    @Override
    public void error(String s, Throwable throwable) {
        System.err.println(s);
        throwable.printStackTrace(System.err);
    }
    @Override
    public void error(String s) {
        System.err.println("MybatisPlusOutImpl::"+s);
    }
    @Override
    public void debug(String s) {
        System.err.println("MybatisPlusOutImpl::"+s);
    }
    @Override
    public void trace(String s) {
        System.err.println("MybatisPlusOutImpl::"+s);
    }
    @Override
    public void warn(String s) {
        System.err.println("MybatisPlusOutImpl::"+s);
    }
}
